unit sqlmonitor;

interface

uses
  SysUtils, Types, Classes, Variants, QTypes, QGraphics, QControls, QForms, 
  QDialogs, QStdCtrls, QButtons, QExtCtrls, IBSQLMonitor, Alap;

type
  TSQLMonitorForm = class(TAlapForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Memo1: TMemo;
    IBSQLMonitor1: TIBSQLMonitor;
    BitBtn1: TBitBtn;
    procedure IBSQLMonitor1SQL(EventText: String; EventTime: TDateTime);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SQLMonitorForm: TSQLMonitorForm;

implementation
Uses KOnstansok, ini, Dm;
{$R *.xfm}

procedure TSQLMonitorForm.IBSQLMonitor1SQL(EventText: String;
  EventTime: TDateTime);
begin
  Memo1.Lines.Add('--------------');
  Memo1.Lines.Add(DateToStr(EventTime)+':'+EventText);
end;

procedure TSQLMonitorForm.FormCreate(Sender: TObject);
begin
  SetClxForm(Self);
  Y2INIFile.FormFromIni(Self);
end;

procedure TSQLMonitorForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
 DMForm.Database.TraceFlags:=[];

 Y2INIFile.FormToIni(Self);
end;

procedure TSQLMonitorForm.FormActivate(Sender: TObject);
begin
  setUserLog(Self.Name);

end;

end.
